
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../../../mobileHeader_inc.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" /> 
<title>发布兼职</title>
<script type="text/javascript">
		function c(){
			var fun_ret;
			var vals = $('#sendWork').serialize();
			var url = '/manage/partTime/addSave';
			var formData = new FormData($('#sendWork')[0]);
			$.ajax({
				async : false,
				type : "POST",
				url : url,
				data : formData,
				cache : false,
				contentType : false,
				processData : false,
				dataType : 'json',
				xhr : function() { 
					myXhr = $.ajaxSettings.xhr();
					if (myXhr.upload) { 
						myXhr.upload.addEventListener('progress',
								progressHandlingFunction, false); 
					}
					return myXhr;
		
				},
				success : function(data) {
		               if(data.success == 0 )
		               {
		            	   fun_ret = true;
		            	   alert("添加成功");
		            	   window.location.href="${ctx}/mobile/goWork";
		               }
		               else
		               {
		            	   alert("添加失败");
		               }
		           },
				error : errorHandler = function(data) {
					alert("添加失败");
					return false;
				}
			});
			return fun_ret;
		}
		function progressHandlingFunction(e) {
			if (e.lengthComputable) {
				$('progress').attr({
					value : e.loaded,
					max : e.total
				});
			}
			}
		</script>

</head>
<body>
<header data-am-widget="header" class="am-header am-header-default joan-head">
      <div class="am-header-left am-header-nav">
          <a href="/mobile/goWork" target="_self" class=""> 返回</a>
      </div>
      <div>
      	<h2 class="am-header-title">
                 	发布兼职
        </h2>
      </div>
  </header>
  <div style="padding-top:20px;">
<form class="am-form" id="sendWork" method="post">
    <div class="am-form-group">
      <label >标题:</label>
      <input type="text" class=""  id="smallTitle" name="smallTitle">
    </div>
    <div class="am-form-group">
      <label >兼职信息详情:</label>
      	<textarea class="" rows="10" id="substance" name="substance"></textarea>
    </div>
    <div align="center">
		<button type="submit" class="am-btn am-btn-default am-round" style="width:50%;" data-ajax="false" onclick="c()">发布</button>
    </div>
</form>
</body>
</html>